import requests
from config import app_config

def call_set_gpt_model():
    response = requests.get(
        f"{app_config.GPT_SOVITS_HOST}/set_gpt_weights",
        params={
            "weights_path": app_config.GPT_SOVITS_GPT_MODEL,
        }
    )

    if response.status_code == 200:
        print(f"已切换到Sovits模型: {app_config.GPT_SOVITS_GPT_MODEL}")
    else:
        raise Exception(f"切换模型请求失败，状态码: {response.status_code}, 信息: {response.text}")
    
def call_set_sovits_model():
    response = requests.get(
        f"{app_config.GPT_SOVITS_HOST}/set_sovits_weights",
        params={
            "weights_path": app_config.GPT_SOVITS_SOVITS_MODEL,
        }
    )

    if response.status_code == 200:
        print(f"已切换到Sovits模型: {app_config.GPT_SOVITS_SOVITS_MODEL}")
    else:
        raise Exception(f"切换模型请求失败，状态码: {response.status_code}, 信息: {response.text}")
    
